package com.forclass.zonghe;

import java.util.ArrayList;
import java.util.List;

public class User {
    private Long id;
    private String name;
    private int age;

    // 私有构造方法
    private User() {}

    // 公共构造方法
    public User(Long id, String name) {
        this.id = id;
        this.name = name;
    }
    // 私有方法
    private void validate() {
        System.out.println("Validating user...");
    }
    // 新增一个返回泛型类型的方法
    public List<String> getGenericList() {
        return new ArrayList<>();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
